package com.qlylkj.lbk.ui.cochain

import android.widget.ImageView
import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.forest.core.etx.load
import com.qlylkj.lbk.R
import com.qlylkj.lbk.app.addHost
import com.qlylkj.lbk.model.bean.CoChainInfo

class CoChainInfoAdapter: BaseQuickAdapter<CoChainInfo,BaseViewHolder>(R.layout.item_co_chain_info) {

    override fun convert(helper: BaseViewHolder, item: CoChainInfo?) {
        helper.run {
            item?.run {
                consumers.apply {
                    val coChainCompanyCoverImage = getView<ImageView>(R.id.coChainCompanyCoverImage)
                    coChainCompanyCoverImage.load(
                        mContext,
                        faceImg.addHost(),
                        RequestOptions().placeholder(R.mipmap.ic_company_cover_default)
                    )
                    setText(R.id.companyNameText, companyName)
                }
                setText(R.id.transactionHashText, transactionHash)
                setText(R.id.timeText, createTime)
            }
        }
    }
}